Skip to content

Conversation

Techassi
Copy link
Member

@Techassi Techassi commented Oct 9, 2025

This trait enables adding one or multiple labels to any Kubernetes resource (through kube's ResourceExt trait).

This feature came out of stackabletech/secret-operator#634 which needs adding of labels to the default custom resources.

let mut tls_secret_class: v1alpha2::SecretClass =
    serde_yaml::with::singleton_map_recursive::deserialize(deserializer)?;

tls_secret_class
    .add_label(Label::instance("secret-operator").unwrap())
    .add_label(Label::managed_by("secret-operator", "secretclass").unwrap())
    .add_label(Label::name("secret-operator").unwrap())
    .add_label(Label::version(built_info::PKG_VERSION).unwrap())
    .add_label(Label::stackable_vendor());

This trait enables adding one or multiple labels to any Kubernetes
resource (through kube's ResourceExt trait).
This adds the following new associated functions to construct
labels:

- `Label::instance`: app.kubernetes.io/instance
- `Label::name`: app.kubernetes.io/name
- `Label::stackable_vendor`: stackable.tech/vendor=Stackable
@Techassi Techassi self-assigned this Oct 9, 2025
@Techassi Techassi moved this to Development: In Progress in Stackable Engineering Oct 9, 2025
@Techassi Techassi marked this pull request as ready for review October 9, 2025 07:57
@Techassi Techassi moved this from Development: In Progress to Development: Waiting for Review in Stackable Engineering Oct 9, 2025
@NickLarsenNZ NickLarsenNZ moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Oct 14, 2025
NickLarsenNZ
NickLarsenNZ previously approved these changes Oct 14, 2025
Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for fixing the doc-comment titles.

Copy link
Member

@NickLarsenNZ NickLarsenNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Techassi Techassi added this pull request to the merge queue Oct 14, 2025
Merged via the queue into main with commit 5184eb3 Oct 14, 2025
8 checks passed
@Techassi Techassi deleted the feat/label-ext branch October 14, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

2 participants